import axios from 'axios'

const instance = axios.create({
  baseURL: 'http://127.0.0.1:5000/api',
})

async function get(url: string, config?: object) {
  return instance.get(url, config).then((response) => {
    return response.data
  })
}

async function post(url: string, data: any, config?: any) {
  return instance.post(url, data, config).then((response) => {
    return response.data
  })
}

export { get, post }
